<% content_for(:header) do %>
  <script type="text/javascript">//<![CDATA[
    var xed;
    window.onload = function() {
        xed = new xq.Editor($("page_source"));
        xed.config.imagePathForDefaultToobar = '/images/toolbar/';
        xed.setEditMode('wysiwyg');
        xed.loadStylesheet("/stylesheets/xq_contents.css");
        xed.getFrame().style.width = "100%";
      //  xed.getFrame().style.height = "400px";
        xed.focus();
    }
    //]]></script>
<% end %>
<h1>New page</h1>

<%= error_messages_for :page %>

<% form_for(:page, :url => pages_path) do |f| %>
  <p>
    <b>Title</b><br />
    <input id="page_title" name="page[title]" size="30" type="text" />
  </p>

  <p>
    <b>Source</b>
  </p>
  <div><textarea cols="40" id="page_source" name="page[source]" rows="20"></textarea></div>

  <p>
    <%= submit_tag "Create" %>
  </p>
<% end %>

<%= link_to 'Back', pages_path %>